
*******COLUMN ONE*******
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)
drop if missing(futret)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

*set panel
tsset permno monthyear
sort monthyear permno
replace futret=futret*100

*gen standard variables
winsor2 convexity_split, cuts(1 99) by(monthyear)
egen convex_std=std(convexity_split_w) 

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret convex_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_6A_1", replace): reg futret convex_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_6A_1", clear
tsset monthyear
newey _b_convex_std, lag(6)

sum _eq2_stat_1


*******COLUMN TWO********
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)
drop if missing(futret)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

*set panel
tsset permno monthyear
sort monthyear permno
replace futret=futret*100

*gen standard variables
rename ret_11_month mom_ret

drop if missing(bm_ratio) | missing(profit) | missing(asset) | missing(mom_ret)

winsor2 convexity_split, cuts(1 99) by(monthyear)
winsor2 mktcap, cuts(1 99) by(monthyear)
winsor2 bm_ratio, cuts(1 99) by(monthyear)
winsor2 profit, cuts(1 99) by(monthyear)
winsor2 asset, cuts(1 99) by(monthyear)
winsor2 mom_ret, cuts(1 99) by(monthyear)

*log variables
gen log_mktcap=log(mktcap_w)
gen log_bm=log(bm_ratio_w)

*gen standard variables
egen convex_std=std(convexity_split_w) 
egen mktcap_std=std(log_mktcap) 
egen bm_std=std(log_bm) 
egen profit_std=std(profit_w)
egen asset_std=std(asset_w)
egen mom_std=std(mom_ret_w)

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret convex_std mktcap_std bm_std profit_std asset_std mom_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_6A_2", replace): reg futret convex_std mktcap_std bm_std profit_std asset_std mom_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_6A_2", clear
tsset monthyear
newey _b_convex_std, lag(6)
newey _b_mktcap_std, lag(6)
newey _b_bm_std, lag(6)
newey _b_profit_std, lag(6)
newey _b_asset_std, lag(6)
newey _b_mom_std, lag(6)

sum _eq2_stat_1

*******COLUMN THREE********
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)
drop if missing(futret)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

*set panel
tsset permno monthyear
sort monthyear permno
replace futret=futret*100

rename ret_11_month mom_ret

drop if missing(bm_ratio) | missing(profit) | missing(asset) | missing(mom_ret) | missing(ret) 

winsor2 convexity_split, cuts(1 99) by(monthyear)
winsor2 mktcap, cuts(1 99) by(monthyear)
winsor2 bm_ratio, cuts(1 99) by(monthyear)
winsor2 profit, cuts(1 99) by(monthyear)
winsor2 asset, cuts(1 99) by(monthyear)
winsor2 mom_ret, cuts(1 99) by(monthyear)
winsor2 ret, cuts(1 99) by(monthyear)

*log variables
gen log_mktcap=log(mktcap_w)
gen log_bm=log(bm_ratio_w)

*gen standard variables
egen convex_std=std(convexity_split_w) 
egen mktcap_std=std(log_mktcap) 
egen bm_std=std(log_bm) 
egen profit_std=std(profit_w)
egen asset_std=std(asset_w)
egen mom_std=std(mom_ret_w)
egen ret_std=std(ret_w)

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret convex_std mktcap_std bm_std profit_std asset_std mom_std ret_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_6A_3", replace): reg futret convex_std mktcap_std bm_std profit_std asset_std mom_std ret_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_6A_3", clear
tsset monthyear
newey _b_convex_std, lag(6)
newey _b_mktcap_std, lag(6)
newey _b_bm_std, lag(6)
newey _b_profit_std, lag(6)
newey _b_asset_std, lag(6)
newey _b_mom_std, lag(6)
newey _b_ret_std, lag(6)

sum _eq2_stat_1

*******COLUMN FOUR********
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)
drop if missing(futret)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

*set panel
tsset permno monthyear
sort monthyear permno
replace futret=futret*100

rename ret_11_month mom_ret

drop if missing(bm_ratio) | missing(profit) | missing(asset) | missing(mom_ret) | missing(illiquid) 

winsor2 convexity_split, cuts(1 99) by(monthyear)
winsor2 mktcap, cuts(1 99) by(monthyear)
winsor2 bm_ratio, cuts(1 99) by(monthyear)
winsor2 profit, cuts(1 99) by(monthyear)
winsor2 asset, cuts(1 99) by(monthyear)
winsor2 mom_ret, cuts(1 99) by(monthyear)
winsor2 illiquid, cuts(1 99) by(monthyear)

*log variables
gen log_mktcap=log(mktcap_w)
gen log_bm=log(bm_ratio_w)

*gen standard variables
egen convex_std=std(convexity_split_w) 
egen mktcap_std=std(log_mktcap) 
egen bm_std=std(log_bm) 
egen profit_std=std(profit_w)
egen asset_std=std(asset_w)
egen mom_std=std(mom_ret_w)
egen illiquid_std=std(illiquid_w)

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret convex_std mktcap_std bm_std profit_std asset_std mom_std illiquid_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_6A_4", replace): reg futret convex_std mktcap_std bm_std profit_std asset_std mom_std illiquid_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_6A_4", clear
tsset monthyear
newey _b_convex_std, lag(6)
newey _b_mktcap_std, lag(6)
newey _b_bm_std, lag(6)
newey _b_profit_std, lag(6)
newey _b_asset_std, lag(6)
newey _b_mom_std, lag(6)
newey _b_illiquid_std, lag(6)

sum _eq2_stat_1


*******COLUMN FIVE****************
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)
drop if missing(futret)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

*set panel
tsset permno monthyear
sort monthyear permno
replace futret=futret*100

rename ret_11_month mom_ret

drop if missing(bm_ratio) | missing(profit) | missing(asset) | missing(mom_ret) | missing(iv_ff3) 

winsor2 convexity_split, cuts(1 99) by(monthyear)
winsor2 mktcap, cuts(1 99) by(monthyear)
winsor2 bm_ratio, cuts(1 99) by(monthyear)
winsor2 profit, cuts(1 99) by(monthyear)
winsor2 asset, cuts(1 99) by(monthyear)
winsor2 mom_ret, cuts(1 99) by(monthyear)
winsor2 iv_ff3, cuts(1 99) by(monthyear)

*log variables
gen log_mktcap=log(mktcap_w)
gen log_bm=log(bm_ratio_w)

*gen standard variables
egen convex_std=std(convexity_split_w) 
egen mktcap_std=std(log_mktcap) 
egen bm_std=std(log_bm) 
egen profit_std=std(profit_w)
egen asset_std=std(asset_w)
egen mom_std=std(mom_ret_w)
egen iv_ff3_std=std(iv_ff3_w)

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret convex_std mktcap_std bm_std profit_std asset_std mom_std iv_ff3_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_6A_5", replace): reg futret convex_std mktcap_std bm_std profit_std asset_std mom_std iv_ff3_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_6A_5", clear
tsset monthyear
newey _b_convex_std, lag(6)
newey _b_mktcap_std, lag(6)
newey _b_bm_std, lag(6)
newey _b_profit_std, lag(6)
newey _b_asset_std, lag(6)
newey _b_mom_std, lag(6)
newey _b_iv_ff3_std, lag(6)

sum _eq2_stat_1


*******COLUMN SIX********
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)
drop if missing(futret)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

*set panel
tsset permno monthyear
sort monthyear permno
replace futret=futret*100

rename ret_11_month mom_ret

drop if missing(bm_ratio) | missing(profit) | missing(asset) | missing(mom_ret) | missing(skew) 

winsor2 convexity_split, cuts(1 99) by(monthyear)
winsor2 mktcap, cuts(1 99) by(monthyear)
winsor2 bm_ratio, cuts(1 99) by(monthyear)
winsor2 profit, cuts(1 99) by(monthyear)
winsor2 asset, cuts(1 99) by(monthyear)
winsor2 mom_ret, cuts(1 99) by(monthyear)
winsor2 skew, cuts(1 99) by(monthyear)

*log variables
gen log_mktcap=log(mktcap_w)
gen log_bm=log(bm_ratio_w)

*gen standard variables
egen convex_std=std(convexity_split_w) 
egen mktcap_std=std(log_mktcap) 
egen bm_std=std(log_bm) 
egen profit_std=std(profit_w)
egen asset_std=std(asset_w)
egen mom_std=std(mom_ret_w)
egen skew_std=std(skew_w)

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret convex_std mktcap_std bm_std profit_std asset_std mom_std skew_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_6A_6", replace): reg futret convex_std mktcap_std bm_std profit_std asset_std mom_std skew_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_6A_6", clear
tsset monthyear
newey _b_convex_std, lag(6)
newey _b_mktcap_std, lag(6)
newey _b_bm_std, lag(6)
newey _b_profit_std, lag(6)
newey _b_asset_std, lag(6)
newey _b_mom_std, lag(6)
newey _b_skew_std, lag(6)

sum _eq2_stat_1

*******COLUMN SEVEN********
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)
drop if missing(futret)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

*set panel
tsset permno monthyear
sort monthyear permno
replace futret=futret*100

rename ret_11_month mom_ret

drop if missing(bm_ratio) | missing(profit) | missing(asset) | missing(mom_ret) | missing(max_ret) 

winsor2 convexity_split, cuts(1 99) by(monthyear)
winsor2 mktcap, cuts(1 99) by(monthyear)
winsor2 bm_ratio, cuts(1 99) by(monthyear)
winsor2 profit, cuts(1 99) by(monthyear)
winsor2 asset, cuts(1 99) by(monthyear)
winsor2 mom_ret, cuts(1 99) by(monthyear)
winsor2 max_ret, cuts(1 99) by(monthyear)

*log variables
gen log_mktcap=log(mktcap_w)
gen log_bm=log(bm_ratio_w)

*gen standard variables
egen convex_std=std(convexity_split_w) 
egen mktcap_std=std(log_mktcap) 
egen bm_std=std(log_bm) 
egen profit_std=std(profit_w)
egen asset_std=std(asset_w)
egen mom_std=std(mom_ret_w)
egen max_std=std(max_ret_w)

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret convex_std mktcap_std bm_std profit_std asset_std mom_std max_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_6A_7", replace): reg futret convex_std mktcap_std bm_std profit_std asset_std mom_std max_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_6A_7", clear
tsset monthyear
newey _b_convex_std, lag(6)
newey _b_mktcap_std, lag(6)
newey _b_bm_std, lag(6)
newey _b_profit_std, lag(6)
newey _b_asset_std, lag(6)
newey _b_mom_std, lag(6)
newey _b_max_std, lag(6)

sum _eq2_stat_1

*******COLUMN EIGHT********
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)
drop if missing(futret)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

*set panel
tsset permno monthyear
sort monthyear permno
replace futret=futret*100

rename ret_11_month mom_ret

drop if missing(bm_ratio) | missing(profit) | missing(asset) | missing(mom_ret) 
drop if missing(max_ret) | missing(iv_ff3) | missing(skew) | missing(illiquid) | missing(ret)

winsor2 convexity_split, cuts(1 99) by(monthyear)
winsor2 mktcap, cuts(1 99) by(monthyear)
winsor2 bm_ratio, cuts(1 99) by(monthyear)
winsor2 profit, cuts(1 99) by(monthyear)
winsor2 asset, cuts(1 99) by(monthyear)
winsor2 mom_ret, cuts(1 99) by(monthyear)
winsor2 ret, cuts(1 99) by(monthyear)
winsor2 iv_ff3, cuts(1 99) by(monthyear)
winsor2 illiquid, cuts(1 99) by(monthyear)
winsor2 skew, cuts(1 99) by(monthyear)
winsor2 max_ret, cuts(1 99) by(monthyear)

*log variables
gen log_mktcap=log(mktcap_w)
gen log_bm=log(bm_ratio_w)

*gen standard variables
egen convex_std=std(convexity_split_w) 
egen mktcap_std=std(log_mktcap) 
egen bm_std=std(log_bm) 
egen profit_std=std(profit_w)
egen asset_std=std(asset_w)
egen mom_std=std(mom_ret_w)
egen ret_std=std(ret_w)
egen iv_ff3_std=std(iv_ff3_w)
egen illiquid_std=std(illiquid_w)
egen skew_std=std(skew_w)
egen max_std=std(max_ret_w)

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret convex_std mktcap_std bm_std profit_std asset_std mom_std ret_std illiquid_std iv_ff3_std skew_std max_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_6A_8", replace): reg futret convex_std mktcap_std bm_std profit_std asset_std mom_std ret_std illiquid_std iv_ff3_std skew_std max_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_6A_8", clear
tsset monthyear
newey _b_convex_std, lag(6)
newey _b_mktcap_std, lag(6)
newey _b_bm_std, lag(6)
newey _b_profit_std, lag(6)
newey _b_asset_std, lag(6)
newey _b_mom_std, lag(6)
newey _b_ret_std, lag(6)
newey _b_illiquid_std, lag(6)
newey _b_iv_ff3_std, lag(6)
newey _b_skew_std, lag(6)
newey _b_max_std, lag(6)

sum _eq2_stat_1
